<?php
/**
 * Created by JetBrains PhpStorm.
 * User: shaoshuai
 * Date: 12-7-16
 * Time: 上午12:50
 * To change this template use File | Settings | File Templates.
 */
class Event
{
    const FIGHT_REQUEST = 1;

    const FIGHT_ACCEPT = 2;

    const FIGHT_START = 3;

    const GAME_WIN = 10;

    const GAME_LOST = 11;

    /**
     * @var array
     */
    protected $data;

    /**
     * @var int
     */
    protected $time;

    /**
     * @var int
     */
    protected $type;

    /**
     * @param array $data
     */
    public function __construct($data)
    {
        $this->data = $data;
        $this->time = time();
        $this->type = $data['type'];
    }

    /**
     * @return array
     */
    public function getData()
    {
        return $this->data;
    }

    /**
     * @return int
     */
    public function getTime()
    {
        return $this->time;
    }

    /**
     * @return int
     */
    public function getType()
    {
        return $this->type;
    }
}
